home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Herois / Codigo.Cst / 00001_Script_Inicio e Fim next >
Text File  |  1999-03-19  |  4KB  |  159 lines

  1. on startMovie
  2.   global myMemSize, eMac
  3.   set myMemSize = the memorySize
  4.   --  set myMemSize = 8192
  5.   if the platform contains "Mac" then
  6.     set eMac = true
  7.   else
  8.     set eMac = false
  9.   end if
  10.   
  11.   -- Variaveis de plataforma
  12.   global gSepPath
  13.   if the platform contains "Mac" then
  14.     set gSepPath = ":"
  15.   else
  16.     set gSepPath = "\"
  17.   end if
  18.   
  19.   -- Garante que arquivos estao fechados
  20.   fechaDB
  21.   fechaTextosDB
  22.   
  23.   -- Abre banco de dados
  24.   global gDB, gPals, gRefs, gArqs
  25.   global V12dbeFact, V12tblFact
  26.   
  27.   -- Tirar comentario para fazer executavel de importacao
  28.   --        ImportaDB
  29.   --        ImportaTextosDB
  30.   --        quit
  31.   --  
  32.   set V12dbeFact = Xtra "V12dbe"
  33.   set V12tblFact = Xtra "V12table"
  34.   
  35.   abreDB   
  36.   
  37.   --  put "Palavras: " & mSelectCount(gPals)
  38.   --  put "Textos: " & mSelectCount(gArqs)
  39.   --  put "Referencias: " & mSelectCount(gRefs) 
  40.   
  41.   abreTextosDB
  42.   
  43.   --  put "Links: " & mSelectCount(gLinks)
  44.   --  put "Textos normais: " & mSelectCount(gSimples)
  45.   --  put "Textos verbetes: " & mSelectCount(gVerbetes)
  46.   
  47.   utilInicializa
  48.   
  49.   -- Algumas globais
  50.   global gCritico
  51.   set gCritico = 0 -- Se esta numa interacao critica, ie, rapida
  52.   
  53.   global gVerbeteUltimo
  54.   set gVerbeteUltimo = 11062
  55.   
  56.   global gAstros, gAstroAtual
  57.   set gAstros = 11004
  58.   set gAstroAtual = gAstros -- Ultimo astro aberto
  59.   
  60.   global gEquipes, gEquipeAtual
  61.   set gEquipes = 10937 -- Primeiro verbete das equipes
  62.   set gEquipeAtual = gEquipes
  63.   
  64.   global gHerois, gHeroiAtual
  65.   set gHerois = 10000 -- Primeiro verbete dos herois
  66.   set gHeroiAtual = gHerois
  67.   
  68.   global gVerbeteAtual
  69.   set gVerbeteAtual = gHeroiAtual
  70.   
  71.   global gTabelaCriadores
  72.   set gTabelaCriadores = [ 32, 5, 9, 10, 27, 16, 17, 12,¼
  73.        37,29,4,23,26,39,25,2,8,19,20,1,6,33,15,13,31,18,¼
  74.        28,36,11,38,14,30,35,22,3,21,24,34,7,40 ]
  75.   
  76.   MelhoresEmbaralha
  77.   
  78.   -- Sons
  79.   global gFundoTempo
  80.   set gFundoTempo = the timer
  81.   
  82.   -- Tabela de "Step Back"
  83.   global gStepBack, gStepBackMax, gStepBackIni, gStepBackUlt
  84.   set gStepBackMax = 100
  85.   set gStepBackIni = 1
  86.   set gStepBackUlt = 1
  87.   set gStepBack = []
  88.   repeat with i = 1 to gStepBackMax
  89.     add gStepBack, 0
  90.   end repeat
  91.   
  92.   -- De onde vem o ultimo frame
  93.   global gDonde -- abertura(0), universos(1), momentos(1000), criadores(2000), verbetes(10000)
  94.   set gDonde = -1
  95.   
  96.   -- Posicao do texto na pagina do Jurassic
  97.   global gJurassicScroll
  98.   set gJurassicScroll = 224
  99.   
  100.   -- Lista de paginas selecionadas
  101.   global gPagSel, gPagArraste
  102.   set gPagSel = []
  103.   set gPagArraste = 0
  104.   
  105.   -- Processa teclado
  106.   set the keyDownScript = "cuidaTeclado"
  107.   
  108.   -- Teclado
  109.   global gTeclado
  110.   set gTeclado = 0
  111.   
  112. end
  113.  
  114. on stopMovie
  115.   fechaDB
  116.   fechaTextosDB
  117.   
  118.   global V12dbeFact, V12tblFact
  119.   set V12dbeFact = 0
  120.   set V12tblFact = 0
  121. end 
  122.  
  123. on cuidaTeclado
  124.   if the frame < marker("Universo") or the frame > marker("Fim") then
  125.     pass
  126.   else
  127.     global gTeclado
  128.     
  129.     set k = charToNum(the key)
  130.     -- PageUp
  131.     if k = 11 then
  132.       fazBack
  133.       return
  134.       
  135.       -- TAB
  136.     else if k = 9 then
  137.       sendSprite 97, #chaveVisibilidade, (not the ligado of sprite 97)
  138.       return
  139.       
  140.       -- F1 ou "1" durante edicao
  141.     else if (k = 16) then
  142.       sendSprite 110, #abreFecha
  143.       return
  144.       
  145.       -- Testa teclas do "Easter Egg"
  146.     else if (the key = "g") then
  147.       set gTeclado = 1
  148.     else if (gTeclado = 1 and the key = "n") then
  149.       set gTeclado = 2
  150.     else if (gTeclado = 2 and the key = "u") then
  151.       sendAllSprites(#cleanSprite)
  152.       go frame "nois"
  153.       
  154.     else
  155.       set gTeclado = 0
  156.       pass
  157.     end if
  158.   end if
  159. end